<?php
	include("include/init.php");//将配置文件全部加载进来

	$photo = new sql_class("article");

	$pageindex = isset($_GET['pageindex']) ? $_GET['pageindex'] : 0 ;
	$limit = 8;
	if($pageindex){
		$start = ($pageindex - 1)*$limit;
		$photo_list = $photo->select("artcate_id = 3")->orderBy(["article_id","DESC"])->limit([$start,$limit])->getAll();
		echo json_encode($photo_list);//将数组转换成json格式
		exit;
	}

	$photo_list = $photo->select("artcate_id = 3")->orderBy(["article_id","DESC"])->limit([0,$limit])->getAll();

	$smarty->assign("photo_list",$photo_list);

	$smarty->display("photo.html");



?>